﻿//almost bellow code from http://bcl.codeplex.com/wikipage (project "Long Path")
//code signature -> Copyright (c) Microsoft Corporation.  All rights reserved.
using System;
using Microsoft.Win32.SafeHandles;

namespace MdeleteAPI
{
    internal sealed class SafeFindHandle : SafeHandleZeroOrMinusOneIsInvalid
    {
        internal SafeFindHandle()
            : base(true)
        {
        }
        protected SafeFindHandle(bool ownsHandle)
            : base(ownsHandle)
        {            
        }         

        protected override bool ReleaseHandle()
        {
            return APIFunction.FindClose(base.handle);
        }
    }
}
